package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.controller.CxBase;
import com.ruoyi.system.domain.PrizeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PrizeWinRecordMapper;
import com.ruoyi.system.domain.PrizeWinRecord;
import com.ruoyi.system.service.IPrizeWinRecordService;

/**
 * 中奖信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-07
 */
@Service
public class PrizeWinRecordServiceImpl extends CxBase implements IPrizeWinRecordService
{
    @Autowired
    private PrizeWinRecordMapper prizeWinRecordMapper;

    /**
     * 查询中奖信息
     * 
     * @param id 中奖信息ID
     * @return 中奖信息
     */
    @Override
    public PrizeWinRecord selectPrizeWinRecordById(Long id)
    {
        PrizeWinRecord prizeWinRecord = prizeWinRecordMapper.selectPrizeWinRecordById(id);
        prizeWinRecord.setPrizeWinDate(StampToString(Long.valueOf(prizeWinRecord.getPrizeWinDate())));
        return prizeWinRecord;
    }

    /**
     * 查询中奖信息列表
     * 
     * @param prizeWinRecord 中奖信息
     * @return 中奖信息
     */
    @Override
    public List<PrizeWinRecord> selectPrizeWinRecordList(PrizeWinRecord prizeWinRecord)
    {
        List<PrizeWinRecord> prizeWinRecords = prizeWinRecordMapper.selectPrizeWinRecordList(prizeWinRecord);
        for(PrizeWinRecord prizeWinRecord1:prizeWinRecords){
            prizeWinRecord1.setPrizeWinDate(StampToString(Long.valueOf(prizeWinRecord1.getPrizeWinDate())));
        }
        return prizeWinRecords;
    }

    /**
     * 新增中奖信息
     * 
     * @param prizeWinRecord 中奖信息
     * @return 结果
     */
    @Override
    public int insertPrizeWinRecord(PrizeWinRecord prizeWinRecord)
    {
        return prizeWinRecordMapper.insertPrizeWinRecord(prizeWinRecord);
    }

    /**
     * 修改中奖信息
     * 
     * @param prizeWinRecord 中奖信息
     * @return 结果
     */
    @Override
    public int updatePrizeWinRecord(PrizeWinRecord prizeWinRecord)
    {
        return prizeWinRecordMapper.updatePrizeWinRecord(prizeWinRecord);
    }

    /**
     * 批量删除中奖信息
     * 
     * @param ids 需要删除的中奖信息ID
     * @return 结果
     */
    @Override
    public int deletePrizeWinRecordByIds(Long[] ids)
    {
        return prizeWinRecordMapper.deletePrizeWinRecordByIds(ids);
    }

    /**
     * 删除中奖信息信息
     * 
     * @param id 中奖信息ID
     * @return 结果
     */
    @Override
    public int deletePrizeWinRecordById(Long id)
    {
        return prizeWinRecordMapper.deletePrizeWinRecordById(id);
    }
}
